package data;

import java.util.LinkedHashSet;
import java.util.Set;

import util.TimeUtil;

public class RefreshData extends Thread {
	private Set<String> keySet;
	public RefreshData(Set<String> keySet) {
		this.keySet = keySet;
	}
	@Override
	public void run() {
		while(true){
			try {
				StockDataFetch.refreshData(keySet);
				Thread.sleep(Constant.URLWAITTIME);
			} catch (InterruptedException e) {
				e.printStackTrace();
				System.out.println("fetcher stopped!!!!!");
			} catch (Exception e) {
				e.printStackTrace();
				System.out.println("fetcher stopped!!!!!");
			}
			if(TimeUtil.afterDeal){
				break;
			}
		}
	}
}